<template>
  <div>
    <p>age: {{ age }}</p>
    <button @click="handleClick">修改 age</button>
    <button @click="handleClick2">修改 num</button>
  </div>
</template>

<script>

export default {
  name: 'Test',
  props: {
    age: {
      type: Number,
      default: 10
    }
  },
  methods: {
    handleClick() {
      this.$emit('update:age', 18)
    },
    handleClick2() {
      this.$emit('update:num', 188)
    }
  }
}
</script>

